﻿<UserControl x:Class="IncrementalSave.FileHistoryViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
             xmlns:IncrementalSave="clr-namespace:IncrementalSave" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Name="MyToolWindow"
             Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}">
    <UserControl.Resources>
        <DataTemplate DataType="{x:Type IncrementalSave:HistoryItem}">
            <DockPanel HorizontalAlignment="Stretch">
                <Border Background="Transparent" Padding="3,2,5,2">
                    <TextBlock Text="{Binding DocumentName}" />
                </Border>
                <TextBlock Margin="0,2,5,2" DockPanel.Dock="Right" Text="{Binding SaveTimeText}" FontStyle="Italic" Foreground="Gray" />
            </DockPanel>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <ListBox x:Name="list" ItemsSource="{Binding Path=HistoryItems}" SelectedItem="{Binding SelectedHistoryItem}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" />
    </Grid>
</UserControl>
